import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/components/ye_xiu/archives/archives_ability_details_item_progress.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/model/ye_xiu/achieves/archieves_ability_detail_entity.dart';
import 'package:flutter_eve_plugin/utils/image_util.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ArchivesAbilityDetailsItemRightWidget extends StatelessWidget {
  final ArchievesAbilityDetailEntity data;

  const ArchivesAbilityDetailsItemRightWidget(
      {Key key, @required this.index, this.data})
      : super(key: key);

  final int index;

  @override
  Widget build(BuildContext context) {
    ArchievesAbilityDetailPropertylist info =
        data.propertyList.length > 0 ? data.propertyList[index] : null;
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Row(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Text(
              '称 号:',
              style: TextStyle(
                  color: Color(0xFFEFF0F8),
                  fontFamily: FontFamily.PINGFANG,
                  fontWeight: FontWeightCustom.PF_Medium,
                  fontSize: setTextSp(15)),
            ),
            SizedBox(
              width: setRatio(10),
            ),
            Stack(
              children: <Widget>[
                Image.asset(
                  imageUtilYeXiu(
                      'archives/icon_archivers_ability_title_border@3x'),
                  width: setRatio(90),
                  height: setRatio(29),
                ),
                Container(
                    width: setRatio(90),
                    height: setRatio(29),
                    child: Center(
                        child: Text('${info?.name}',
                            textAlign: TextAlign.center,
                            style: TextStyle(
                              color: Color(0xFFFFFFFF),
                              fontSize: setTextSp(13),
                            ))))
              ],
            )
          ],
        ),
        SizedBox(
          height: setRatio(1),
        ),
        Row(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Text(
              '等 级：',
              style: TextStyle(
                  color: Color(0xFFEFF0F8),
                  fontFamily: FontFamily.PINGFANG,
                  fontWeight: FontWeightCustom.PF_Medium,
                  fontSize: setTextSp(15)),
            ),
            SizedBox(
              width: setRatio(10),
            ),
            Text(
              '${info?.level}级',
              style: TextStyle(
                  color: Color(0xFFFFBF13),
                  fontFamily: FontFamily.PINGFANG,
                  fontWeight: FontWeightCustom.PF_Medium,
                  fontSize: setTextSp(15)),
            ),
          ],
        ),
        SizedBox(
          height: setRatio(7),
        ),
        ArchivesAbilityDetailsItemProgressWidget(index: index, info: info)
      ],
    );
  }
}
